// 公共接口
import { request } from "@/utils/http.js";

import globalConfig from "@/utils/config.js";

const baseUrl = globalConfig.microUrl;

export default {
  // 轮播图
  bannerList: (data) => {
    // platform 1pc 2小程序
    return request({
      url: `${baseUrl}/ct/banner/list`,
      method: "GET",
      data
    });
  },
  // 品牌列表
  brandList: (data) => {
    return request({
      url: `${baseUrl}/ct/brandPreference/list`,
      method: "GET",
      data
    });
  },
  // 资讯
  zxList: (data) => {
    return request({
      url: `${baseUrl}/ct/news/list`,
      method: "GET",
      data
    });
  },
  // 推荐商品
  suggestGoods: (data) => {
    return request({
      url: `${baseUrl}/ct/goodsRecommend/list`,
      method: "GET",
      data
    });
  },
  // 采购需求分页
  buyList: (data) => {
    return request({
      url: `${baseUrl}/sa/procure/page`,
      method: "GET",
      data
    });
  },
  // 求购信息
  supplyGoods: (data) => {
    return request({
      url: `${baseUrl}/gd/goods/supplyGoods`,
      methods: "GET",
      data
    });
  },
  // 首页 推荐商品
  recommendGoods: (data) => {
    return request({
      url: `${baseUrl}/gd/goods/getIndexRecommendGoods`,
      method: "GET",
      data
    });
  },
  // 最新成交
  latestList: (data) => {
    return request({
      url: `${baseUrl}/gd/goods/getLatelySale`,
      method: "GET",
      data
    });
  },
  // 精选店铺
  recommendStore: (data) => {
    return request({
      url: `${baseUrl}/gd/goods/getIndexRecommendStoreAndGoods`,
      method: "GET",
      data
    });
  },
  // 热门推荐商品
  getHotCateGoods: (data) => {
    return request({
      url: `${baseUrl}/gd/goods/getIndexHotCateGoods`,
      method: "GET",
      data
    });
  },
  // 首页公告_最近一条公告
  getRecentNotification: (data) => {
    return request({
      url: `${baseUrl}/ct/notice/getRecentNotice`,
      method: "GET",
      data
    });
  }
};
